﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Factura.aspx.cs" Inherits="ForrajeriaFRONT.Factura" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register src="~/userCtrl/wusBusqueda.ascx" TagName="Busqueda" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

    <style type="text/css">
        .invisible
        {
            visibility:hidden;
        }
        .style2
        {
            width: 148px;
        }
        .style3
        {
            width: 151px;
        }
        .style4
        {
            width: 150px;
        }
        .style5
        {
            width: 149px;
        }
        .style6
        {
            width: 224px;
        }
        .style7
        {
            width: 149px;
            height: 51px;
        }
        .style8
        {
            width: 224px;
            height: 51px;
        }
    </style>
    
<script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    
 <script language="javascript" type="text/javascript">

    
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="carga">

   
        <table>
            <tbody>
                <tr>
                    <td class="style2">
                        
                    </td>
                    <td class="style3">
                    </td>

                </tr>
                 <tr>
                    <td class="style2">
                        <asp:Label ID="lblTipoFactura" runat="server" Text="Factura Tipo"></asp:Label>
                     </td>
                    <td class="style3">
                        <asp:DropDownList ID="ddlTipoFactura" runat="server" >
                            <asp:ListItem>A</asp:ListItem>
                            <asp:ListItem>B</asp:ListItem>
                            <asp:ListItem>C</asp:ListItem>
                        </asp:DropDownList>
                    </td>


                </tr>
                 <tr>
                    <td class="style2">
                        &nbsp;</td>
                    <td class="style3">
                        &nbsp;</td>
                     
                </tr>
                <tr>
                    <td>  &nbsp;</td>
               </tr>
               <tr> 
                    <td>  <asp:Button ID="btnBuscarCliente" runat="server" Text="BuscarCliente" 
                            onclick="btnBuscarCliente_Click" CausesValidation="false" />
                    </td>
                    <td></td>
                    <td></td>
               </tr>
               <tr>
                    <td>
                        <asp:Label ID="lblNombreCliente" runat="server" Text="Nombre"></asp:Label>
                    </td>
                    <td><asp:TextBox ID="txtNombreCliente" runat="server" Text=""></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblNroCliente" runat="server" Text="Numero Cliente"></asp:Label>
                     </td>
                    <td><asp:TextBox ID="txtNroCliente" runat="server" Text=""></asp:TextBox>
                        <asp:CustomValidator ID="CustomValidator3" runat="server" ErrorMessage="*" 
                            ForeColor="Red" onservervalidate="CustomValidator3_ServerValidate1" 
                            ValidateEmptyText="True" ValidationGroup="cliente" ></asp:CustomValidator>
                    </td>
               </tr>
                 <tr>
                    <td class="style2">
                        <asp:Label ID="lblApellidoCliente" runat="server" Text="Apellido"></asp:Label>
                     </td>
                    <td class="style3"><asp:TextBox ID="txtApellidoCliente" runat="server" Text=""></asp:TextBox>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                 <tr>
                    <td class="style2">
                        <asp:Label ID="lblTipoDocumento" runat="server" Text="Tipo De Documento"></asp:Label>
                     </td>
                    <td class="style3">
                        <asp:TextBox ID="txtTipoDocumento" runat="server"></asp:TextBox>
                        
                     </td>
                    <td>
                        &nbsp;</td>
                    <td>&nbsp;</td>

                </tr>
                <tr><td><asp:Label ID="lblNroDocumento" runat="server" Text="Numero Documento:"></asp:Label>
                        
                    </td>
                    <td>
                        <asp:TextBox ID="txtDocumentoCliente" runat="server" Text=""></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp; &nbsp;</td>
                </tr>
                
                 <tr>
                    <td class="style2">
                        <asp:Label ID="lblNumeroPedido" runat="server" Text="Numero De Pedido"></asp:Label>
                    </td>
                    <td class="style3">
                        <asp:TextBox ID="txtNroPedido" runat="server" Text=""></asp:TextBox>
                    </td>

                </tr>
                 <tr>
                    <td class="style2">
                        &nbsp;</td>
                    <td class="style3"><asp:Button ID="btnBuscarPedido" runat="server" Text="Buscar Pedido" 
            onclick="btnBuscarPedido_Click"  CausesValidation="true" />
                    </td>

                </tr>

            </tbody>
        </table>
    </div>
    <br />

    <div id="AgregarForraje">   
        <table >
            <tbody>
            <tr><td>  <asp:Button ID="btnBuscarForraje" runat="server" Text="Buscar Forraje" 
            onclick="btnBuscarForraje_Click" CausesValidation="false" /></td></tr>
                <tr>
                    <td><asp:Label ID="lblForraje" runat="server" Text="Forraje"></asp:Label>
                    </td>
                    <td class="style6"><asp:TextBox ID="txtForraje" runat="server" Text="" Height="16px"></asp:TextBox><asp:CustomValidator
                            ID="CustomValidator2" runat="server" ErrorMessage="*" ForeColor="Red" 
                            onservervalidate="CustomValidator2_ServerValidate" 
                            ValidationGroup="forraje"></asp:CustomValidator></td>
                    <td>
                        <asp:Label ID="lblPeso" runat="server" Text="Peso Paquete"></asp:Label></td>
                    <td><asp:TextBox ID="txtPeso" runat="server" Text=""></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="style5"><asp:Label ID="lblMarca" runat="server" Text="Marca"></asp:Label>
                    </td>
                    <td class="style6">
                        <asp:TextBox ID="txtMarca" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblPrecioXKilo" runat="server" Text="Precio Por Kilo"></asp:Label></td>
                    <td class="style4">
                        <asp:TextBox ID="txtPrecioXkilo" runat="server" Text=""></asp:TextBox>
                   </td>
                </tr>
                <tr>
                    <td class="style5">
                        <asp:Label ID="lblEdad" runat="server" Text="Edad"></asp:Label></td>
                    <td class="style6">
                        <asp:TextBox ID="txtEdad" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblCantidad" runat="server" Text="Cantidad"></asp:Label></td>
                    <td class="style4">
                    
                        <asp:TextBox ID="txtCantidad"  runat="server"/>
                        <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="*" 
                            ForeColor="Red" onservervalidate="CustomValidator1_ServerValidate" 
                            ValidationGroup="forraje"></asp:CustomValidator>
                        <asp:RangeValidator
                                ID="RangeValidator1" runat="server" ErrorMessage="*" 
                            ControlToValidate="txtCantidad" ForeColor="Red" MaximumValue="500" 
                            MinimumValue="1" Type="Integer" ValidationGroup="forraje">*</asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style5" rowspan="2">
                        <asp:Label ID="lblDescripcion" runat="server" Text="Descripcion"></asp:Label></td>
                    <td class="style6" rowspan="2">
                        <asp:TextBox ID="txtDescripcion" runat="server" TextMode="MultiLine" text="" 
                            Rows="2"  Width="217px"></asp:TextBox></td>
                    <td>
                        &nbsp;</td>
                    <td class="style4">&nbsp;</td>
                </tr>
                <tr>
                    <td class="style7">
                        <asp:CustomValidator ID="CustomValidator6" runat="server" 
                            ErrorMessage="Stock Insuficiente" ForeColor="Red" 
                            onservervalidate="CustomValidator6_ServerValidate" ValidationGroup="forraje"></asp:CustomValidator>
                        </td>
                    <td class="style8">  <asp:Button ID="btnDetalle" runat="server" Text="Agregar Detalle" 
                        onclick="btnDetalle_Click" /></td>
                    
                </tr>
                <tr><td></td><td></td><td>  <asp:Label ID="lblTotal" runat="server" Text="Total" /></td><td><asp:TextBox ID="txtTotal" runat="server" ReadOnly="true" Text="0" style="text-align:right;" /></td></tr>
            </tbody>
        </table>
        <br />
    </div>
    <asp:Panel ID="Panel2" runat="server" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" Width="100%">
     
   <asp:Label ID="lblDetalle" runat="server" Text="Detalles  " Font-Size="Large" /><asp:CustomValidator
       ID="CustomValidator5" runat="server" ErrorMessage="*"  ForeColor="Red" 
            Font-Bold="true" onservervalidate="CustomValidator5_ServerValidate" 
            ValidationGroup="detalle"></asp:CustomValidator>
        <asp:CustomValidator ID="CustomValidator4" runat="server"  ForeColor="Red" 
            Width="50%"  ErrorMessage="No se puede Eliminar una Parte del pedido" 
            onservervalidate="CustomValidator4_ServerValidate1" ValidationGroup="eliminar"></asp:CustomValidator>
    </asp:Panel>
    <br />
    <div id="detalles">
        <asp:GridView ID="gv_detalles" runat="server" AutoGenerateColumns="False"  
            CellPadding="4" ForeColor="#333333" GridLines="None" ShowHeaderWhenEmpty="True" 
            Width="100%" Height="137px" DataKeyNames="Key1,Texto8" 
            onrowdeleting="gv_detalles_RowDeleting" >
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Texto2" HeaderText="Cantidad" />
                <asp:BoundField DataField="Texto1" HeaderText="Descripcion" />
                <asp:BoundField DataField="Texto3" HeaderText="Precio Por Kilo" />
                <asp:BoundField DataField="Texto4" HeaderText="Subtotal" />
                <asp:CommandField ButtonType="Image" DeleteImageUrl="~/images/borrarABM.jpg" 
                    HeaderText="Quitar" ShowDeleteButton="True" ShowHeader="True" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        
    </div>
    <div>

        
        
       

       

      

    </div>
   
   
    <asp:Panel ID="panel1" runat="server" CssClass="modalPopup" Width="100%" 
        Height="267px"  >
       <uc1:Busqueda id="usrBusqueda" runat="server" OnRowSelected="onRowSelected" >
       </uc1:Busqueda>
    </asp:Panel>
    <asp:Button ID="btnFake" Width="0px" Height="0px" CssClass="invisible" runat="server" />
    <asp:ModalPopupExtender TargetControlID="btnFake" ID="pnlModal_ModalPopupExtender"
        runat="server" DynamicServicePath="" Enabled="True"  
        PopupControlID="panel1" DropShadow="true" BackgroundCssClass="modalBackground">
        
</asp:ModalPopupExtender>
<table style="float:right">
<tr>
<td>
    <asp:Label ID="lblMensaje" runat="server" Text="" Visible ="false"></asp:Label>
    </td>
<td></td>
<td>

<asp:Button ID="btnGuardar" Text="Guardar" runat="server" Width="130px" 
        Height="35px" onclick="btnGuardar_Click" CausesValidation="true" ValidationGroup="cliente" />
</td>
<td ></td>
<td>
<asp:Button ID="btnNuevo" Text="Nuevo" runat="server" Width="130px" Height="35px" 
        CausesValidation="false" onclick="btnNuevo_Click" />

</td>
</tr>
</table>
</asp:Content>
